package com.gzy.wbapplication.modules.log;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gzy.wbapplication.R;
import com.gzy.wbapplication.model.MyLog;
import com.gzy.wbapplication.utils.DateUtils;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public class LogAdapter extends BaseQuickAdapter<MyLog, BaseViewHolder> implements LoadMoreModule {
    public LogAdapter(@Nullable List<MyLog> data) {
        super(R.layout.item_log, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, MyLog myLog) {
        baseViewHolder.setText(R.id.tv_content,myLog.getContent());
        baseViewHolder.setText(R.id.tv_date, DateUtils.timeStamp2Date(myLog.getCreateAt(),""));
    }
}
